package rs.networx.util;

import java.util.Date;

import rs.networx.entity.Person;

public class CleanUpDateOfBirth {
	public String cleanUpDateOfBirth(Date dateOfBirth, Person personToLogin){
		String result = null;
		
		System.out.println("tu sam");
		
		if(personToLogin != null){
			System.out.println(dateOfBirth);
			
			String dateOfBirthDB = dateOfBirth.toString();
			
			int i = dateOfBirthDB.indexOf(" ");
			System.out.println("i: " + i);
			
			String temp = dateOfBirthDB.substring(0, i);
			System.out.println("ddd: " + temp);
			
			String[] array = temp.split("-");
			
			System.out.println(array[0]);
			System.out.println(array[1]);
			System.out.println(array[2]);
			System.out.println(array[2] + "/" + array[1] + "/" + array[0]);
			
			result = array[2] + "/" + array[1] + "/" + array[0];
		}
		return result;
	}
}
